<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a="https://ajax4jsf.dev.java.net/ajax"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:c="http://java.sun.com/jstl/core"
	template="../include/template.xhtml">

	<ui:define name="pageTitle">
		<h:outputText value="项目" />
	</ui:define>
	<ui:define name="logoTitle">
		<h:outputText value="项目" />
	</ui:define>

	<ui:define name="content">
		<style type="text/css">
<!--
.footClass {
	margin: 0px;
	text-align: left;
	border: 0px #c0d5e6 solid;
	background-color: #fff;
	border: 0px #c0d5e6 solid;
}
-->
</style>
		<rich:spacer height="4px" />
		<a:form style="margin:0">
			<rich:simpleTogglePanel switchType="client" label="分类"
				style="width:29%;height:300px;float: left;background-color:#{a4jSkin.generalBackgroundColor};"
				headerClass="headerClass">
				<a:repeat value="#{categoryAction_oneLevelCategory}"
					var="category">
					<h:outputText value="+ " />
					<a:commandLink value="#{category.name}" styleClass="strong"
						action="#{taskIndexAction.searchSubCategory(category.name)}"
						title="#{category.name}" />
					<h:panelGrid columns="2" style="padding:0;margin:0">
						<a:repeat value="#{category.children}" var="child">
							<a:commandLink value="#{child.name}," title="#{child.name}"
								action="#{taskIndexAction.searchSubCategory(child.name)}" />
						</a:repeat>
					</h:panelGrid>
				</a:repeat>
			</rich:simpleTogglePanel>

			<rich:simpleTogglePanel switchType="client"
				style="width:70%;height:300px;float: right;background-color:#{a4jSkin.generalBackgroundColor};"
				headerClass="headerClass">
				<f:facet name="header">
					<h:outputText value="热门项目列表" />
				</f:facet>
				<rich:dataGrid value="#{taskIndexAction_hotTasks}" columns="1"
					var="vtask" styleClass="dataGridClass" columnClasses="spaceClass" footerClass="footClass">
					<rich:spacer width="10px" />
					<h:outputText value="#{vtask.id}." />
					<rich:spacer width="10px" />
					<h:outputText value="[#{vtask.tag}]" escape="false" />
					<rich:spacer width="6px" />
					<h:outputLink value="view-#{vtask.type}-#{vtask.id}"
						title="#{vtask.name}">
						<h:outputText value="#{vtask.name}" escape="false" />
					</h:outputLink>
					<rich:spacer width="10px" />
					<h:outputText value="￥#{vtask.budget}元" />
					<rich:spacer width="10px"></rich:spacer>
					<h:outputText value="[" />
					<h:outputText value="#{vtask.publishDate}">
						<s:convertDateTime pattern="yyyy-MM-dd HH:mm:ss" />
					</h:outputText>
					<h:outputText value="]" />
				</rich:dataGrid>
			</rich:simpleTogglePanel>

		</a:form>
		<div style="clear: both;"></div>
		<rich:spacer height="1px" />
		<a:form style="margin:0">
			<c:forEach items="#{categoryAction_oneLevelCategory}"
				var="cat">
				<rich:simpleTogglePanel switchType="client"
					rendered="#{taskIndexAction.getPagedTasksByCategory(cat).count>0}"
					style="width:99.6%" headerClass="headerClass">
					<f:facet name="header">
						<s:div styleClass="headerClass">
							<h:outputText value="#{cat.name}" />
						</s:div>
					</f:facet>
					<s:div>
						<rich:dataGrid value="#{taskIndexAction.getPagedTasksByCategory(cat)}"
							columns="1" var="vtask" styleClass="dataGridClass" elements="10"
							columnClasses="spaceClass" footerClass="footClass">
							<rich:spacer width="10px" />
							<h:outputText value="#{vtask.id}." />
							<rich:spacer width="10px" />
							<h:outputText value="[#{vtask.tag}]" escape="false" />
							<rich:spacer width="6px" />
							<h:outputLink value="view-#{vtask.type}-#{vtask.id}"
								title="#{vtask.name}">
								<h:outputText value="#{vtask.name}" escape="false" />
							</h:outputLink>
							<rich:spacer width="10px" />
							<h:outputText value="￥#{vtask.budget}元" />
							<rich:spacer width="10px"></rich:spacer>
							<h:outputText value="[#{vtask.publishDate}]"></h:outputText>

							<f:facet name="footer">
								<rich:datascroller maxPages="10" align="left"
									tableStyle="border-style:none;background:transparent;"
									styleClass="dataGridClass"
									rendered="#{taskIndexAction.getPagedTasksByCategory(cat).count>10}">
								</rich:datascroller>
							</f:facet>
						</rich:dataGrid>
					</s:div>
				</rich:simpleTogglePanel>
				<rich:spacer height="2px"></rich:spacer>
			</c:forEach>
		</a:form>
	</ui:define>
</ui:composition>
